﻿using System.Collections.Generic;
using MyMovieCollection.DATA.DataAccess.Interfaces;
using MyMovieCollection.DATA.Models;
using MyMovieCollection.DATA.DataAccess.AR;

namespace MyMovieCollection.Services.Catalog
{
    public class CatalogService : ICatalogService
    {
        private readonly IMovieDao movieDao = new MovieDao();
        private readonly IMovieTypeDao movieTypeDao = new MovieTypeDao();

        public Movie GetMovie(int id)
        {
            return movieDao.GetById(id);
        }

        public List<Movie> GetAllMovies()
        {
            return movieDao.GetAll();
        }

        public void AddMovie(Movie movie)
        {
            movieDao.AddMovie(movie);
        }

        public List<Movie> GetMoviesByMovieType(MovieType movieType)
        {
            return movieDao.GetByMovieType(movieType);
        }

        public List<Movie> GetMoviesByMoviePointScale(double minPoint, double maxPoint)
        {
            return movieDao.GetByMoviePointScale(minPoint, maxPoint);
        }

        public List<Movie> GetAllMoviesByCategoryAndPointScale(PointScale pointScale, MovieType Category)
        {
            return movieDao.GetAllByCategoryAndPointScale(pointScale, Category);
        }

        public List<Movie> GetAllMoviesByCriterias(string Name, int Year, PointScale pointScale, MovieType category)
        {
            return movieDao.GetAllByCriterias(Name, Year, pointScale, category);
        }

        public void DeleteMovie(int movieID)
        {
            movieDao.DeleteMovie(movieID);
        }

        public List<MovieType> GetAllMovieTypes()
        {
            return movieTypeDao.GetAll();
        }

        public void AddMovieType(MovieType movieType)
        {
           movieTypeDao.AddMovieType(movieType);
        }

        public MovieType GetMovieType(int id)
        {
           return  movieTypeDao.GetById(id);
        }
    }
}
